package studentinformationmanagementsystem.service;

import studentinformationmanagementsystem.entity.Classandgrade;
import studentinformationmanagementsystem.entity.Department;
import studentinformationmanagementsystem.entity.Page;

import java.util.List;

/**
 * @author 苗庆
 * @version 1.0
 */
public interface DepartmentService {

    /**
     * 添加院系信息
     *
     * @param department
     */
    int register(Department department);


    /**
     *  根据ID更新院系信息
     * @param department  院系对象
     * @return 受影响的记录行数
     */
    int update(Department department);


    /**
     *  根据ID删除院系
     * @param department 院系ID
     * @return 受影响的记录行数
     */
    int delete(Department department);

    /**
     * 查询所有院系信息
     * @return 所有院系信息
     */
    List<Department> queryAll();


    /**
     * 根据院系ID查询院系信息
     * @param department 院系ID
     * @return 院系信息
     */
    Department queryById(Department department);


    /**
     * 分页查询
     * @param pageNo  查询页码
     * @param pageSize  每页的记录数
     * @return
     */
    Page<Department> page(int pageNo, int pageSize);


    /**
     * 检查院系名称是否已存在
     * @param department
     * @return true 院系名称已存在
     */
    boolean isExistsDepartmentNname(Department department);

    Integer queryDepartmentCount ();
}
